
/*banner划屏*/
var sWidth = $(".pichow").width();
var len = $(".pichow ul li").length;
var i_bnr = 0;
var picTimer;

for (var i = 0; i < len; i++) {
	$(".picture .litBtn").append("<a href='#'><span></span></a>")
}

$(".picture .litBtn a").mouseenter(function() {
	i_bnr = $(".picture .litBtn a").index(this);
	showPics(i_bnr);
}).eq(0).trigger("mouseenter");

$(".pichow ul").css("width", sWidth * (len));

$(".pichow").hover(function() {
	clearInterval(picTimer);
}, function() {
	picTimer = setInterval(function() {
		showPics(i_bnr);
		i_bnr++;
		if (i_bnr == len) {
			i_bnr = 0;
		}
	}, 4000);
}).trigger("mouseleave");

function showPics(index) {
	var nowLeft = -index * sWidth;
	$(".pichow ul").stop(true, false).animate({
		"margin-left": nowLeft
	}, 300);
	$(".picture .litBtn a").removeClass("on").eq(index).addClass("on");
}
/*banner划屏*/
var sWidtht = $(".imginformation").width();
var lent = $(".imginformation ul li").length;
var i_bnrt = 0;
var picTimer;
for (var i = 0; i < lent; i++) {
	$(".information .litBtntwo").append("<a href='#'><span></span></a>")
}
$(".information .litBtntwo a").mouseenter(function() {
	i_bnrt = $(".information .litBtntwo a").index(this);
	showPicstt(i_bnrt);
}).eq(0).trigger("mouseenter");

$(".imginformation ul").css("width", sWidtht * (lent));

$(".imginformation").hover(function() {
	clearInterval(picTimer);
}, function() {
	picTimer = setInterval(function() {
		showPicstt(i_bnrt);
		i_bnr++;
		if (i_bnr == lent) {
			i_bnr = 0;
		}
	}, 4000);
}).trigger("mouseleave");

function showPicstt(index) {
	var nowLeft = -index * sWidtht;
	$(".imginformation ul").stop(true, false).animate({
		"margin-left": nowLeft
	}, 300);
	$(".information .litBtntwo a").removeClass("on").eq(index).addClass("on");
}
/*图片信息弹出*/
$(".hid_list li").find(".hold").hide();
var sldTime;
$(".hid_list li").hover(function() {
	var ngood = $(this);
	sldTime = setTimeout(function() {
		ngood.find(".hold").slideDown(400)
	}, 100);
}, function() {
	clearTimeout(sldTime);
	$(this).find(".hold").slideUp(400);
})
$(".exclusive_list li").find(".movie_hold").hide();
var sldTime;
$(".exclusive_list li").hover(function() {
	var ngood = $(this);
	sldTime = setTimeout(function() {
		ngood.find(".movie_hold").slideDown(400)
	}, 100);
}, function() {
	clearTimeout(sldTime);
	$(this).find(".movie_hold").slideUp(400);
})
$(function() {
	/*划屏滚动*/

	// $("#pichow").owlCarousel({
	// 	singleItem: true,
	// 	autoPlay: true,
	// 	stopOnHover: true,
	// 	transitionStyle: "fade"
	// });
	$('#pichow').owlCarousel({
        items: 1,
        navigation: false,
        animateOut: 'fadeOut',
        loop: true,
        autoplay:true,
        autoplayTimeout:4000,
        autoplayHoverPause:true
    });
})



//电影杂志免费读
var picTimer1;

$(".movie_read_list").hover(function() {
	var now = $(".movie_read_list").index(this);
	picTimer1 = setTimeout(function() {
		showMovies(now);
	}, 200);
}, function() {
	clearTimeout(picTimer1);
});

function showMovies(index) {
	$(".movie_ygpout").hide().eq(index).show();
	$(".movie_read_list").removeClass("dj").eq(index).addClass("dj");
}


// 书报亭下载引导
var flag=true;
init();
$(".gb").click(function(){
      
      $('.cfc').animate({width:"0%"},1000,function(){
      	$('.cfc').hide();
      	$('.dfc').show();
      });

      });
  $(".dfc").click(function(){
      $('.cfc').show();
      $('.dfc').hide();
      	$('.cfc').animate({width:"100%"},500);

      });
        function init(){
 		if(flag){
 		$('.cfc').show();
      $('.dfc').hide();
      
      	$('.cfc').animate({width:"100%"},500);
      	$('.cfc .pic').animate({display:"none"},600);
          setTimeout(function(){
            $('.cfc').animate({width:"0%"},1000,function(){
      	$('.cfc').hide();
      	$('.dfc').show();
      	 
      });
            init();
          },10000);
          flag=false;
        }
      }
	        
        var mobilereg = /^1[3|4|5|8]\d{9}$/;
        function sendmess(pagetype){
        	var mobilenum = $("#downloadnumber").val();
        	if(null == mobilenum || '' == mobilenum || !mobilereg.test(mobilenum) || mobilenum.length!=11){
        		$("#mobileerror").html("请填写有效手机号码");
        		$("#downloadnumber").focus();
        		changeStatusBar();
        		return false;
        	}else{
        		$("#mobileerror").html("");
        	}
        	
        	var url_remote = "/mvc/sendsms/loadappurl?type="+pagetype;
        	url_remote = encodeURI(url_remote);
        	$.post(url_remote, {"mobile":mobilenum}, function(data){
        		if("0" == data){
        			$("#mobileerror").html("已发送");
        			changeStatusBar();
        		}else if("1" == data){
        			$("#mobileerror").html("请填写正确的手机号码");
        			changeStatusBar();
        		}else if("2"==data){
        			$("#mobileerror").html("太频繁啦，休息5分钟再发吧!");
        			changeStatusBar();
        		}else if("3"==data){
        			$("#mobileerror").html("短信发送失败，请重新获取下载链接");
        			changeStatusBar();
        		}else{
        			$("#mobileerror").html("短信发送失败，请重新获取下载链接");
        			changeStatusBar();
        		}
        	});
        }

        //5秒消失效果
        function changeStatusBar(){
            rcTimeout =setTimeout("window.status=''",5000);//代码字符表达式,毫秒数===即前者为空
            rcTimeout1 = setTimeout("$('#mobileerror').html('')",5000);
        }

